package mk.jug.academy.service;


import mk.jug.academy.model.Lecturer;
import mk.jug.academy.model.Page;
import mk.jug.academy.model.Student;
import mk.jug.academy.model.StudentReview;
import mk.jug.academy.model.StudentReviewStatus;


/**
 * Defines the contract for the services targeting
 * the student reviewing functionality.
 *
 * @author Ice.Penov
 */
public interface StudentReviewService {
	
	/**
	 * A {@link Lecturer}, starts a {@link StudentReview} for the given {@link Student}.
	 * 
	 * @param student the student subject to review
	 * @param lecturer the reviewed
	 * @param studentReview the contents of the student review
	 */
	void startReview(Student student, Lecturer lecturer, StudentReview studentReview);

	/**
	 * Gets the {@link StudentReview} having {@link StudentReviewStatus#BEING_DEFINED} status,
	 * in a paged manner.
	 */
	Page<StudentReview> listCurrentlyDefined(int pageNumber, int itemsPerPage);
	
	/**
	 * Gets the {@link StudentReview}s having {@link StudentReviewStatus#COMPLETE} status,
	 * in a paged manner.
	 */
	Page<StudentReview> listCompleted(int pageNumber, int itemsPerPage);
	
	/**
	 * Gets the {@link StudentReview}s having {@link StudentReviewStatus#DELETED} status,
	 * in a paged manner.
	 */
	Page<StudentReview> listDeleted(int pageNumber, int itemsPerPage);
	
	/**
	 * Continues the {@link StudentReview} with the new modifications.
	 * The {@link StudentReview} must be (and stay) in the {@link StudentReviewStatus#BEING_DEFINED} status.
	 */
	void continueReview(StudentReview studentReview);
	
	/**
	 * Completes a {@link StudentReview}.
	 */
	void completeReview(StudentReview studentReview);

	/**
	 * Deletes a {@link StudentReview}.
	 */
	void deleteReview(StudentReview studentReview);
	
	/**
	 * Loads the {@link StudentReview} from the persistence layer. 
	 * 
	 * @param id the unique identifier
	 * @return the loaded entity
	 */
	StudentReview load(Long id);

}